IF EXISTS(SELECT * FROM SYSOBJECTS WHERE name = 'Subjects' AND xtype = 'U')
BEGIN
	DROP TABLE Subjects
END
GO

IF NOT EXISTS(SELECT * FROM SYSOBJECTS WHERE name = 'Subjects' AND xtype = 'U')
BEGIN
	CREATE TABLE Subjects
	(
		SubjectId			int not null IDENTITY(1,1),
		CargaHoraria		int not null,
		SubjectName			varchar(100) not null,
	)
END
GO

IF NOT EXISTS(SELECT * FROM SYSOBJECTS WHERE name = 'pk_SubjectsId' AND xtype = 'PK')
BEGIN
	ALTER TABLE Subjects
	ADD CONSTRAINT pk_SubjectsId PRIMARY KEY ([SubjectId])
END
GO